import request from '@/utils/request'

// 查询ygabc_borrow列表
export function listBorrow(query) {
  return request({
    url: '/system/borrow/list',
    method: 'get',
    params: query
  })
}

// 查询ygabc_borrow详细
export function getBorrow(id) {
  return request({
    url: '/system/borrow/' + id,
    method: 'get'
  })
}

// 新增ygabc_borrow
export function addBorrow(data) {
  return request({
    url: '/system/borrow',
    method: 'post',
    data: data
  })
}

// 修改ygabc_borrow
export function updateBorrow(data) {
  return request({
    url: '/system/borrow',
    method: 'put',
    data: data
  })
}

// 删除ygabc_borrow
export function delBorrow(id) {
  return request({
    url: '/system/borrow/' + id,
    method: 'delete'
  })
}
// 借书
export function borrowBook(bookid) {
  return request({
      url: '/system/borrow/borrow/' + bookid,
      method: 'post',
  })
}

// 还书
export function returnBook(borrowid) {
  return request({
      url: '/system/borrow/returnbook/' + borrowid,
      method: 'put'
  })
}
//续租
export function rentbook(borrowid) {
  return request({
      url: '/system/borrow/rentbook/' + borrowid,
      method: 'put'
  })
}